{extend name='public/layout' /}
{block name='search'}{/block}
{block name='content'}
<link rel="stylesheet" href="__CSS__/user_bind.css">
<div class="main reg clearfix">
    <div class="reg_m clearfix">
        <div class="l">
            <div class="wrap">
                <div class="r_title">
                    <h3>账号绑定</h3>
                    <p>没有{$site.title}账号，填写账号密码将会注册新账号并绑定账号</p>
                    <p>已有{$site.title}账号，填写账号密码将会绑定账号</p>
                </div>
                <form action="{:url('user.login/bind')}" method="post" onsubmit="return check();">
                    <ul class="clearfix">
                        <li class="clearfix"><label>昵称：</label>{$nickname}</li>
                        <li class="clearfix"><label><em>*</em>用户名：</label><input class="input-text usr inpx" id="username" name="username"  type="text" data-default="用户名/邮箱" placeholder="用户名/邮箱" /></li>
                        <li class="clearfix"><label><em>*</em>密码：</label>
                            <input class="input-text inpx" type="password" id="password" placeholder="密码" name="password">
                        </li>
                        <li class="clearfix"><label><em>*</em>验证码：</label><input class="yzm  inpx" name="verfiy" id="captcha_code" type="text" style="width:100px;float:left; margin-right:10px" /><span><a href="javascript:;"><img style="float:left;" id="verfiy" class="verfiy" src="{:captcha_src()}" width="92" height="32"  /></a><a class="verfiy" style="cursor:pointer" >看不清？</a></span></li>
                    </ul>
                    <div class="btn">
                        <input class="sub" type="submit" value="绑定会员">
                    </div>
                    <div class="r_title">
                        <p>如果您忘记密码了，可以从这里取回密码？<a target="_blank" href="{:url('user.login/pass')}">取回密码？</a></p>
                        <p>如果您没有会员账号，可以通过注册新账号进入注册。 <a target="_blank" href="{:url('user.login/reg')}">注册新账号</a></p>
                    </div>
                </form>
            </div>
        </div>
        <div class="r">
            <div class="rt allf60">
                已经注册？请 <a href="{:url('user.login/index')}">直接登录&gt;&gt;</a>
            </div>
            <div class="rm">
                <p>选择其它快捷登录方式</p>
                <span class="login_qq"><a href="{:url('user.login/login',['type'=>'qq'])}"></a></span>
                <span class="login_sina"><a href="{:url('user.login/login',['type'=>'sina'])}"></a></span>
            </div>
        </div>
    </div>
</div>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>
    $(function(){
        $(".verfiy").click(function(){
            var timenow = new Date().getTime();
            $('#verfiy').attr("src","{:captcha_src()}?t"+timenow);
        });
    });
    function check(){
        var username = $('#username').val(),password = $('#password').val(),code = $('#captcha_code').val();
        if(username.length == 0){
            layer.msg('请填写用户名',{icon:2});
            return false;
        }
        if(password.length<6){
            layer.msg('密码长度至少6位',{icon:2});
            return false;
        }
        if(code.length == 0){
            layer.msg('请填写验证码',{icon:2});
            return false;
        }
        return true;
    }

</script>
{/block}